| Main difference between ToString("D2") and ToString("00") or add prefix zero?
To understand this we wil take a example of .ToString() method to convert value to string. Below is the example to do that
double d = 3.55123d;
int i = 4;
int j = 5;
Console.Write(i.ToString("D2"));
Console.Write(d.ToString("00"));
Console.Write(j.ToString("D2"));
Here in above code example first line will return "04" and second will also the same value "04" but third will return "05". So the difference in "00" and "D2" is "00" will handle the decimal and roundoff the result. | | |